package sigeco.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.validator.NotNull;

/**
 * Cell Class.
 * 
 * Represents a Cell in a Competency Matrix that associates
 * a Knowledge to an Ability.
 * 
 * @author julien
 */
@Entity
@Table(name = "cells")
public class Cell {

	private Matrix matrix;
	private Knowledge knowledge;
	private Ability ability;
	private long id;
	
	@OneToOne(targetEntity = Knowledge.class)
	@NotNull
	public Knowledge getKnowledge() {
		return this.knowledge;
	}
	public void setKnowledge(final Knowledge knowledge) {
		this.knowledge = knowledge;
	}
	
	@OneToOne(targetEntity = Ability.class)
	@NotNull
	public Ability getAbility() {
		return this.ability;
	}
	public void setAbility(final Ability ability) {
		this.ability = ability;
	}
	
	@ManyToOne
	@NotNull
	public Matrix getMatrix() {
		return this.matrix;
	}
	public void setMatrix(final Matrix matrix) {
		this.matrix = matrix;
	}
	
	@Id
	@GeneratedValue
	public long getId() {
		return this.id;
	}

	public void setId(final long id) {
		this.id = id;
	}
	
}
